<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>#SingleInstance</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>#SingleInstance</h1>

<p>Determines whether a script is allowed to run again when it is already running.</p>

<pre class="Syntax">#SingleInstance [force|ignore|off]</pre>
<h3>Parameters</h3>
<dl>

  <dt>force|ignore|off</dt>
  <dd><p>This parameter determines what happens when a script is launched while a previous instance of itself is already running:</p>
      <p>The word FORCE skips the  dialog box and replaces the old instance automatically, which is similar in effect to the <a href="Reload.htm">Reload</a> command.</p>            
      <p>The word IGNORE skips the  dialog box and leaves the old instance running. In other words, attempts to launch an already-running script are ignored.</p>
      <p>The word OFF  allows multiple instances of the script to run concurrently.</p>
      <p>If the parameter is omitted, a dialog box is displayed asking whether to keep the old instance or replace it with the new one.</p></dd>

</dl>
<h3>Remarks</h3>
<p>A script containing <a href="../Hotkeys.htm">hotkeys</a>, <a href="../Hotstrings.htm">hotstrings</a>, <a href="_Persistent.htm">#Persistent</a>, <a href="OnMessage.htm">OnMessage()</a>, or <a href="Gui.htm">Gui</a> is single-instance (dialog &amp; prompt) by default. Other scripts default to allowing multiple instances. This behavior can be disabled or modified as described above.</p>
<h3>Related</h3>
<p><a href="Reload.htm">Reload</a>, <a href="_Persistent.htm">#Persistent</a></p>
<h3>Example</h3>
<pre class="NoIndent">#SingleInstance force
#SingleInstance ignore
#SingleInstance off</pre>

</body>
</html>
